"use strict";
cc._RF.push(module, '19d92BRe9JPf6n8sxG5fFwm', '_RegResultHandler');
// _RegResultHandler.js

"use strict";

// @import
var mod_GetRankResultHandler = require("./CustomResultHandler/_GetRankResultHandler");

var mod_MsgRecognizer = require("./_MsgRecognizer");

var mod_MsgSender = require("./_MsgSender");

var mod_SelectHeroResultHandler = require("./CustomResultHandler/_SelectHeroResultHandler");

var mod_UserAttkResultHandler = require("./CustomResultHandler/_UserAttkResultHandler");

var mod_UserDieResultHandler = require("./CustomResultHandler/_UserDieResultHandler");

var mod_UserEntryResultHandler = require("./CustomResultHandler/_UserEntryResultHandler");

var mod_UserLoginResultHandler = require("./CustomResultHandler/_UserLoginResultHandler");

var mod_UserMoveToResultHandler = require("./CustomResultHandler/_UserMoveToResultHandler");

var mod_UserQuitResultHandler = require("./CustomResultHandler/_UserQuitResultHandler");

var mod_UserSubtractHpResultHandler = require("./CustomResultHandler/_UserSubtractHpResultHandler");

var mod_WhoElseIsHereResultHandler = require("./CustomResultHandler/_WhoElseIsHereResultHandler"); // @export


module.exports = {
  /**
   * 注册结果处理器
   */
  regResultHandler: function regResultHandler() {
    // 结果处理器字典
    var oResultHandlerKV = {
      "UserEntryResult": mod_UserEntryResultHandler,
      "WhoElseIsHereResult": mod_WhoElseIsHereResultHandler,
      "UserMoveToResult": mod_UserMoveToResultHandler,
      "UserQuitResult": mod_UserQuitResultHandler,
      "UserAttkResult": mod_UserAttkResultHandler,
      "UserSubtractHpResult": mod_UserSubtractHpResultHandler,
      "UserDieResult": mod_UserDieResultHandler,
      "UserLoginResult": mod_UserLoginResultHandler,
      "SelectHeroResult": mod_SelectHeroResultHandler,
      "GetRankResult": mod_GetRankResultHandler
    }; // @override

    mod_MsgSender.onReceiveMsg = function (oMsg) {
      if (!oMsg || !oMsg.msgCode) {
        return;
      } // 获取消息代号


      var strMsgCode = oMsg.msgCode; // 识别消息类型

      var strMsgType = mod_MsgRecognizer.recognize(strMsgCode);

      if (!strMsgType) {
        // 如果无法识别为消息类型,
        console.error("\u65E0\u6CD5\u8BC6\u522B\u4E3A\u6D88\u606F\u7C7B\u578B, msgCode = " + strMsgCode);
        return;
      }

      try {
        // 加载处理器
        var oResultHandler = oResultHandlerKV[strMsgType]; // 处理消息

        oResultHandler.handle(oMsg.msgBody);
      } catch (oErr) {
        console.error(oErr);
      }
    };
  }
};

cc._RF.pop();